//
//  RootTableViewCell.m
//  UI_豆瓣更新版
//
//  Created by dllo on 15/12/31.
//  Copyright © 2015年 lanou3g. All rights reserved.
//

#import "RootTableViewCell.h"
#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height
@implementation RootTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubviews];
    }
    return self;
}

- (void)dealloc {
    [_blueView release];
    [_whiteView release];
    [_img1 release];
    [_img2 release];
    [_img3 release];
    [_imgView release];
    [_timeLabel release];
    [_addressLabel release];
    [_label1 release];
    [_label2 release];
    [_label3 release];
    [_label4 release];
    [_label5 release];
    [_label6 release];
    [_label7 release];
    [super dealloc];
}

- (void)createSubviews {
    self.blueView = [[UIImageView alloc] init];
    [self.contentView addSubview:_blueView];
    [_blueView release];
    
    self.whiteView = [[UIImageView alloc] init];
    [self.contentView addSubview:_whiteView];
    [_whiteView release];
    
    self.img1 = [[UIImageView alloc] init];
    [self.contentView addSubview:_img1];
    [_img1 release];
    
    self.img2 = [[UIImageView alloc] init];
    [self.contentView addSubview:_img2];
    [_img2 release];
    
    self.img3 = [[UIImageView alloc] init];
    [self.contentView addSubview:_img3];
    [_img3 release];
    
    self.imgView = [[UIImageView alloc] init];
    [self.contentView addSubview:_imgView];
    [_imgView release];
    
    self.timeLabel = [[UILabel alloc] init];
    [self.contentView addSubview:_timeLabel];
    [_timeLabel release];
    
    self.addressLabel = [[UILabel alloc] init];
    [self.contentView addSubview:_addressLabel];
    [_addressLabel release];
    
    self.label1 = [[UILabel alloc] init];
    [self.contentView addSubview:_label1];
    [_label1 release];
    
    self.label2 = [[UILabel alloc] init];
    [self.contentView addSubview:_label2];
    [_label2 release];
    
    self.label3 = [[UILabel alloc] init];
    [self.contentView addSubview:_label3];
    [_label3 release];
    
    self.label4 = [[UILabel alloc] init];
    [self.contentView addSubview:_label4];
    [_label4 release];
    
    self.label5 = [[UILabel alloc] init];
    [self.contentView addSubview:_label5];
    [_label5 release];
    
    self.label6 = [[UILabel alloc] init];
    [self.contentView addSubview:_label6];
    [_label6 release];
    
    self.label7 = [[UILabel alloc] init];
    [self.contentView addSubview:_label7];
    [_label7 release];
}


- (void)layoutSubviews {
    [super layoutSubviews];
    // 蓝色底框
    _blueView.frame = CGRectMake(15, 10, self.contentView.frame.size.width - 30, self.contentView.frame.size.height - 20);
    _blueView.image = [UIImage imageNamed:@"bg_eventlistcell@2x.png"];
    // 白色边框
    _whiteView.frame = CGRectMake(17, 50, self.contentView.frame.size.width - 34, self.contentView.frame.size.height - 70);
    _whiteView.image = [UIImage imageNamed:@"bg_share_large@2x.png"];
    // 活动图片
    _imgView.frame = CGRectMake(WIDTH - 125, 56, 95, 145);
    // 活动名称
    _label1.frame = CGRectMake(17, 10, self.contentView.frame.size.width - 34, 40);
    // 时间图标
    _img1.frame = CGRectMake(25, 60, 25, 25);
    _img1.image = [UIImage imageNamed:@"icon_date@2x.png"];
    // 时间Label
    _timeLabel.frame = CGRectMake(55, 60, 230, 25);
    _timeLabel.font = [UIFont systemFontOfSize:15];
    
    // 地点图标
    _img2.frame = CGRectMake(25, 90, 25, 25);
    _img2.image = [UIImage imageNamed:@"icon_spot@2x.png"];
    // 地点label
    _addressLabel.frame = CGRectMake(55, 90, 195, 25);
//    _addressLabel.backgroundColor = [UIColor redColor];
    _addressLabel.font = [UIFont systemFontOfSize:15];
    
    // 类型图标
    _img3.frame = CGRectMake(25, 120, 25, 25);
    _img3.image = [UIImage imageNamed:@"icon_catalog@2x.png"];
    // 类型label
    _label2.frame = CGRectMake(55, 120, 50, 25);
    _label2.text = @"类型: ";
    _label2.font = [UIFont systemFontOfSize:15];
    _label3.frame = CGRectMake(105, 120, 60, 25);
    _label3.font = [UIFont systemFontOfSize:15];
    // 感兴趣label
    _label4.frame = CGRectMake(30, 170, 65, 25);
    _label4.text = @"感兴趣:";
    _label4.font = [UIFont systemFontOfSize:15];
    _label5.frame = CGRectMake(85, 170, 50, 25);
    _label5.textColor = [UIColor redColor];
    _label5.font = [UIFont systemFontOfSize:15];
    
    _label6.frame = CGRectMake(140, 170, 50, 25);
    _label6.text = @"参加:";
    _label6.font = [UIFont systemFontOfSize:15];
    _label7.frame = CGRectMake(177, 170, 50, 25);
    _label7.textColor = [UIColor redColor];
    _label7.font = [UIFont systemFontOfSize:15];
    
    
    
    
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
